//
//  UITableView+UKQueueCell.m
//  UKListManager
//
//  Created by ET|冰琳 on 16/11/4.
//  Copyright © 2016年 UK. All rights reserved.
//

#import "UITableView+UKQueueCell.h"

@implementation UITableView (UKQueueCell)

- (void)queueInCell:(Class)cellClass{
    NSString *cellIdenti = NSStringFromClass(cellClass);
    [self queueInCell:cellClass withIdentifier:cellIdenti];
}

- (void)queueInCell:(Class)cellClass withIdentifier:(NSString *)identifier{
    NSString *clsStr = NSStringFromClass(cellClass);
    if ([[NSBundle mainBundle] pathForResource:clsStr ofType:@"nib"]) {
        [self registerNib:[UINib nibWithNibName:clsStr bundle:nil] forCellReuseIdentifier:identifier];
    }else{
        [self registerClass:cellClass forCellReuseIdentifier:identifier];
    }
}


- (void)queueInHeaderFooter:(Class)headerFooterClass withIdentifier:(NSString *)identifier{
    
    NSString *classStr = NSStringFromClass(headerFooterClass);
    if ([[NSBundle mainBundle] pathForResource:classStr ofType:@"nib"]) {
        [self registerNib:[UINib nibWithNibName:classStr bundle:nil] forHeaderFooterViewReuseIdentifier:identifier];
    }else{
        [self registerClass:headerFooterClass forHeaderFooterViewReuseIdentifier:identifier];
    }
}


@end
